package com.citycloud.ccuap.tc.admin.repository;

import com.citycloud.ccuap.commons.sys.entity.SysDeptment;
import org.springframework.data.mybatis.repository.support.MybatisRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 项目部门数据库操作
 * @author sufeng
 *
 */

@Repository("sysProjectDeptmentRepository")
public interface SysProjectDeptmentRepository extends MybatisRepository<SysDeptment, Long> {

	Long countByGroupIdAndProjectIdAndDataStatusAndPidNullAndOrgGuidNotNull(Long groupId, long l, int i);

	List<SysDeptment> findByPidNullAndOrgGuidNotNullAndGroupIdAndProjectIdAndDataStatusOrderByOrderNo(Long groupId,
                                                                                                      long l, int i);

	List<SysDeptment> findByPidAndProjectIdAndDataStatusAndOrgGuidNotNullOrderByOrderNo(Long deptId, long l, int i);

	Long countByPidAndProjectIdAndDataStatusAndOrgGuidNotNull(Long deptId, long l, int i);

	SysDeptment findByOrgGuid(String guid);

	SysDeptment findByDeptId(Long deptId);

	List<SysDeptment> findByGroupIdAndDataStatusOrderByOrderNo(Long groupId, int status);

	

}